﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;
using System.Windows.Controls;

namespace Hugo.UIPages
{
    class CanvasWrapperUIPage : UIPage
    {
        private Canvas canvas;
        public CanvasWrapperUIPage(String name, BitmapSource s, Canvas c) : base(name, s)
        {
            this.canvas = c;
            this.overridesHandCursor = true;
        }

        public override string getDescription()
        {
            return "";
        }

        public override void setPage()
        {
            PageCanvas.Children.Add(canvas);
            if (canvas is PlayGamesPage)
            {
                PlayGamesPage pgp = (PlayGamesPage)canvas;
                pgp.startTracking();
            }
            base.setPage();
        }

        public override void unSetPage()
        {
            PageCanvas.Children.Remove(canvas);
            if (canvas is PlayGamesPage)
            {
                PlayGamesPage pgp = (PlayGamesPage)canvas;
                pgp.stopTracking();
            }
            base.setPage();
        }
    }
}
